/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.zx.sys.msg.push.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeesite.common.entity.Page;
import com.jeesite.common.service.CrudService;
import com.jeesite.modules.zx.sys.msg.push.entity.ZxMsgPush;
import com.jeesite.modules.zx.sys.msg.push.dao.ZxMsgPushDao;
import com.jeesite.modules.file.utils.FileUploadUtils;

/**
 * 系统消息表Service
 * @author zpp
 * @version 2020-01-17
 */
@Service
@Transactional(readOnly=true)
public class ZxMsgPushService extends CrudService<ZxMsgPushDao, ZxMsgPush> {
	
	/**
	 * 获取单条数据
	 * @param zxMsgPush
	 * @return
	 */
	@Override
	public ZxMsgPush get(ZxMsgPush zxMsgPush) {
		return super.get(zxMsgPush);
	}
	
	/**
	 * 查询分页数据
	 * @param zxMsgPush 查询条件
	 * @param zxMsgPush.page 分页对象
	 * @return
	 */
	@Override
	public Page<ZxMsgPush> findPage(ZxMsgPush zxMsgPush) {
		return super.findPage(zxMsgPush);
	}
	
	/**
	 * 保存数据（插入或更新）
	 * @param zxMsgPush
	 */
	@Override
	@Transactional(readOnly=false)
	public void save(ZxMsgPush zxMsgPush) {
		super.save(zxMsgPush);
		// 保存上传图片
		FileUploadUtils.saveFileUpload(zxMsgPush.getId(), "zxMsgPush_image");
		// 保存上传附件
		FileUploadUtils.saveFileUpload(zxMsgPush.getId(), "zxMsgPush_file");
	}
	
	/**
	 * 更新状态
	 * @param zxMsgPush
	 */
	@Override
	@Transactional(readOnly=false)
	public void updateStatus(ZxMsgPush zxMsgPush) {
		super.updateStatus(zxMsgPush);
	}
	
	/**
	 * 删除数据
	 * @param zxMsgPush
	 */
	@Override
	@Transactional(readOnly=false)
	public void delete(ZxMsgPush zxMsgPush) {
		super.delete(zxMsgPush);
	}
	
}